from pandas import DataFrame
import pandas as pd


def 掉线人次人数统计(batch):
    return f"D:\\temp\\radius数据\\{batch}\\radius掉线人次人数统计.csv"


def getPath(batch):
    return f"D:\\temp\\radius数据\\{batch}\\去除企宽用户.csv"


def 千兆中断(batch):
    return f"D:\\temp\\radius数据\\{batch}\\去除企宽用户千兆.csv"


def get_df(batch, cols: list) -> DataFrame:
    df = pd.read_csv(getPath(batch), usecols=cols)
    if 'account' in cols:
        df['account'] = df['account'].str[1:]
    return df


def cols():
    return ['所属小区', '所属机房', '分公司', 'account', 'bandwidth', 'mac', 'online_time',
            'offline_time', 'duration', 'flow_in', 'flow_out', 'offline_type',
            'olt_ip', 'pon', 'onu_id', 'sn', 'level', 'alarm_name', 'alarm_source',
            'additional', 'happen_time', 'clear_time', 'confirm_time', 'olt_pon']
